import React, { Component } from 'react'

export default class Registe extends Component {
  //   state = {
  //     username: '',
  //     password: '',
  //     repassword: '',
  //   }

  //   handleChange = (name) => {
  //     return (e) => {
  //       this.setState({
  //         [name]: e.target.value,
  //       })
  //     }
  //   }
  render() {
    return (
      <div>
        <h1>注册</h1>
        <form>
          用户名:
          <input
            type="text"
            value={this.props.username}
            onChange={this.props.handleChange('username')}
          />
          <br />
          密码:
          <input
            type="password"
            value={this.props.password}
            onChange={this.props.handleChange('password')}
          />
          <br />
          确认密码:
          <input
            type="password"
            value={this.props.repassword}
            onChange={this.props.handleChange('repassword')}
          />
          <br />
          <input type="button" value="注册" />
        </form>
      </div>
    )
  }
}
